package website;

import cn.hutool.core.thread.ConcurrencyTester;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

/**
 * @Author: 582895699@qq.com
 * @Desctription:
 * @Date: Created in 2023/1/14 16:22
 */
@Slf4j
public class HttpTest {
    public static void main(String[] args) {
        ConcurrencyTester concurrencyTester = ThreadUtil.concurrencyTest(20, () -> {
            HttpRequest get = HttpUtil.createGet("http://localhost:8080/auth/send?email=18428077179@163.com");
            get.header("Authorization", "Bearer 0e3eeb8c-56ae-45db-ba29-f554545c5b54");
            HttpResponse execute = get.execute();
            log.info("body:{}", execute.body());
        });

        try {
            concurrencyTester.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
